<template>
  <el-dialog :visible.sync="dialogVisible" :before-close="beforeClose" :title="dialogTitle">
    <div class="centered-dialog">
      <img :src="base64Image" alt="" width="300px" height="200px" />
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'previewDialog',
  props: {
    base64Image: {
      type: String,
      required: true
    },
    dialogVisible: {
      type: Boolean,
      required: true
    },
    dialogTitle: {
      type: String,
      default: '预览电子签章照片'
    }
  },
  methods: {
    beforeClose(done) {
      this.$emit('update:dialogVisible', false);
      done();
    }
  }
}


</script>

<style scoped lang="scss">
.centered-dialog {
  align-items: center;
  justify-content: center;
  display: flex;
}
</style>